package com.kfzx.www.mycalendardemo;

import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {
    private List<Fragment> mFragmentList = new ArrayList<>();
    private ViewPager mViewPager;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mViewPager = (ViewPager) findViewById(R.id.view_pager_main);

        mFragmentList.add(new Fragment2());
        mFragmentList.add(new Fragment1());
        mFragmentList.add(new Fragment1());

//        initFragment();
        CustomFragmentPagerStateAdapter adapter = new CustomFragmentPagerStateAdapter(getSupportFragmentManager(), mFragmentList);
        mViewPager.setAdapter(adapter);

    }


}
